package com.mall.observer;

import java.util.Observable;

public class MallObserver extends Observable {
    public static final String TYPE_DRUGS_LOAD_ONE_PAGE = "type_drugs_load_one_page";
    private static volatile MallObserver observer;

    private MallObserver() {
    }

    public static MallObserver getInstance() {
        if (observer == null) {
            synchronized (MallObserver.class) {
                if (observer == null) {
                    observer = new MallObserver();
                }
            }
        }
        return observer;
    }

    public void onMallDrugsLoadOnePage() {
        setChanged();
        notifyObservers(new MallObserverBean(TYPE_DRUGS_LOAD_ONE_PAGE));
    }

    public static class MallObserverBean {
        private String type;

        public MallObserverBean(String type) {
            this.type = type;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }
    }
}
